package com.shiguiwu.springmybatis.designpattern.visitor;

import com.shiguiwu.springmybatis.designpattern.visitor.impl.Student;
import com.shiguiwu.springmybatis.designpattern.visitor.impl.Teacher;

import java.util.ArrayList;
import java.util.List;

/**
 * @description: 看板类
 * @author: stone
 * @date: Created by 2021/10/29 16:48
 * @version: 1.0.0
 * @pakeage: com.shiguiwu.springmybatis.designpattern.visitor
 */
public class DataView {

    List<User> userList = new ArrayList<User>();

    public DataView() {
        userList.add(new Student("谢飞机", "重点班", "一年一班"));
        userList.add(new Student("windy", "重点班", "一年一班"));
        userList.add(new Student("大毛", "普通班", "二年三班"));
        userList.add(new Student("Shing", "普通班", "三年年四班"));
        userList.add(new Teacher("BK", "特级教师", "一年年一班"));
        userList.add(new Teacher("娜娜Goddess", "特级教师", "一年年一班"));
        userList.add(new Teacher("dangdang", "普通教师", "二年三班"));
        userList.add(new Teacher("泽东", "实习教师", "三年四班"));
    }

    public void show(Visitor visitor) {
        for (User user : userList) {
            user.accept(visitor);
        }
    }
}
